<?php
/**
 * @author spenceryg
 * @date 2022/12/3
 * @time 3:44 下午
 * @focus love & life
 */


namespace app\auto\controller;


use app\auto\business\TableBusiness;
use think\facade\View;
use think\response\Json;
use hg\apidoc\annotation as Apidoc;


/**
 * Class App
 * @Apidoc\Title("应用")
 * @Apidoc\Group("自动生成")
 * @Apidoc\Sort(1)
 */
class App extends \app\BaseController
{
    /**
     * index
     * @Apidoc\Title("应用的列表方法")
     * @Apidoc\Desc("最基础的接口注释写法")
     * @Apidoc\Method("GET")
     * @Apidoc\Author("spencer")
     * @Apidoc\Tag("auto")
     * @return string
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function index(): string
    {
        $apps = \app\auto\model\App::select();
        View::assign('data', $apps);
        return View::fetch();
    }


    /**
     * setSysField
     * @return Json
     */
    public function setSysField(): Json
    {
        $data = input();
        \app\auto\model\App::update($data);
        return success('操作成功！');
    }



    public function add()
    {
        return '待开发中。。。';
    }



}
